package com.xj.oop1;

public class Master {

    //重载：方法名相同，参数不同（数量，类型）
    public void train(Dog dog) {
        System.out.println(dog.getColor() + "色的狗狗" + dog.getName() + "在吃肉");
    }

    public void train(Monkey monkey) {
        System.out.println(monkey.getColor() + "色的猴子" + monkey.getName() + "在吃零食");
    }

    public static void main(String[] args) {
        Master master = new Master();
        Dog haPi = new Dog("哈皮", "黑色");
        master.train(haPi);

        Monkey xiaoJia = new Monkey("小佳", "白色");
        master.train(xiaoJia);
    }

}
